function getTimeForHeader(){var d = new Date();return d.getFullYear() + ' 年'+ (d.getMonth() + 1) +' 月'+ d.getDate() +' 日 '+ d.getHours() +':'+ d.getMinutes() +':'+ (d.getSeconds()<10? '0':'') + d.getSeconds();}
$('#header_top_now_time').text(getTimeForHeader());
var clock = setInterval(function(){ $('#header_top_now_time').text(getTimeForHeader());}, 1000);

var history_mine_box = {
	'blockAll' : function(t){
		$(t).parent().children('a[class=button_active]').each(function(){
			$(this).removeClass();
			$(this).addClass('button');
		});
		$(t).parent().children('div#history_box').hide();
		$(t).parent().children('div#mine_box').hide();
	},
	'showHistory' : function(t){
		$(t).removeClass();
		$(t).addClass('button_active');
		$(t).parent().children('div#history_box').show();
	},
	'showMine' : function(t){
		$(t).removeClass();
		$(t).addClass('button_active');
		$(t).parent().children('div#mine_box').show();
	}
};

var zijin_billboard_box = {
	'blockAll' : function(t){
		$(t).parent().children('a[class=button_active]').each(function(){
			$(this).removeClass();
			$(this).addClass('button');
		});
		$(t).parent().children('div#zijin_box').hide();
		$(t).parent().children('div#billboard_box').hide();
	},
	'showZijin' : function(t){
		$(t).removeClass();
		$(t).addClass('button_active');
		$(t).parent().children('div#zijin_box').show();
	},
	'showBillboard' : function(t){
		$(t).removeClass();
		$(t).addClass('button_active');
		$(t).parent().children('div#billboard_box').show();
	}
};

var index_info_box_1 = {
	'blockAll' : function(t){
		$(t).parent().children('a').removeClass();
		$(t).parents('.index_info_box_1').children('.info_box').each(function(){
			$(this).hide();
		});
	},
	'show' : function(t, box_name){
		index_info_box_1.blockAll(t);
		$(t).addClass('active');
		$(t).parents('.index_info_box_1').children('div#'+box_name).show();
	}
};
var index_mid_newsbox = {
	'nowIndex' : 1,
	'maxIndex' : 1,
	'showPrev' : function(t,maxIndex){
		index_mid_newsbox.maxIndex = maxIndex;
		var prevIndexNum = index_mid_newsbox.nowIndex - 1;
		if(prevIndexNum < 1) prevIndexNum = index_mid_newsbox.maxIndex;
		index_mid_newsbox.show(t, prevIndexNum);
	},
	'showNext' : function(t,maxIndex){
		index_mid_newsbox.maxIndex = maxIndex;
		var nextIndexNum = index_mid_newsbox.nowIndex + 1;
		if(nextIndexNum > index_mid_newsbox.maxIndex) nextIndexNum = 1;
		index_mid_newsbox.show(t, nextIndexNum);
	},
	'show' : function(t, i){
		index_mid_newsbox.nowIndex = i;
		$(t).parent().children('span[id$="_now_page"]').html(i);
		index_mid_newsbox.blockAll(t);
		$(t).parent().parent().children('div[id="_'+i+'_index_mid_newsinfo"]').show();
	},
	'blockAll' : function(t){
		$(t).parent().parent().children('div[id$="_index_mid_newsinfo"]').each(function(){
			$(this).hide();
		});
	}
};

var index_stock_info_pic = {
	'show' : function(t, i){
		
		$(t).parent().children('.tab_button').each(function(){
			$(this).removeClass('active');
		});
		$(t).addClass('active');
		
		$(t).parents('#index_stock_info').children('#index_stock_pic_kt').hide();
		$(t).parents('#index_stock_info').children('#index_stock_pic_kd').hide();
		$(t).parents('#index_stock_info').children('#index_stock_pic_kw').hide();
		$(t).parents('#index_stock_info').children('#index_stock_pic_km').hide();
		
		$(t).parents('#index_stock_info').children('#index_stock_pic_'+i).show();
	}
};

var index_stock_more_info = {
	'show' : function(t, i){
		$(t).parent().children('.tab_button').each(function(){
			$(this).removeClass('active');
		});
		$(t).addClass('active');
		
		$(t).parent().parent().children('div[id$="_index_stock_more_pic"]').each(function(){
			$(this).hide();
		});
		$(t).parent().parent().children('div[id="_'+i+'_index_stock_more_pic"]').show();
	}
};
